package com.taotao.rest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.taotao.common.pojo.TaotaoResult;
import com.taotao.rest.service.ContentService;

@Controller
public class ContentControler {
	@Autowired
	private ContentService contentService;
	
	@RequestMapping("/content/list/{categoryId}")
	@ResponseBody
	public TaotaoResult getContentListByCid(@PathVariable Long categoryId) {
		TaotaoResult result;
		try {
			result= contentService.getContentListByCid(categoryId);
		}
		catch (Exception e) {
			return TaotaoResult.build(500, e.getMessage());
		}
		return result;
		
	}
}
